<%@ page import="com.conversationboard.config.*" %>
<%@ page import="com.conversationboard.model.*" %>
<%@ page import="com.conversationboard.controller.confirm.*" %>
<%@ page import="com.conversationboard.formatter.AutoLinkFormatter" %>

<%@page pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>

<%
	User user = User.get(request.getUserPrincipal().getName());
	UserProfile profile = user.getUserProfile();
%>

<%@page import="com.conversationboard.view.MainMenu"%>
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<title>Edit User Profile</title>
	<link rel="stylesheet" type="text/css" href="<%=Configuration.getInstance().getRoot()%>/Stylesheets/<%=StyleSheets.getStyleSheetFileName(request.getCookies())%>">
</head>

<body>

	<%= MainMenu.display(request.getUserPrincipal()) %>

	<div class="headingblock">
		<h1>Edit User Profile</h1>
	</div>

	<div class="mainblock">

		<p>The information in this profile will only be shown when a user clicks on your user ID below any of your posts</p>

		<form class="formsection" action="<%=Configuration.getInstance().getRoot()%>/EditProfileControllerServlet" method="post">
		 	
		 	<%= profile.getFullName() %>
		 	<label for="Name">Your Full Name:</label><br />
		 	<input name="name" class="smalltextbox" type="text" size=100 value="<%= profile.getFullName() %>" /><br /><br />
		 	<label for="email">Your Email Address (if you want to make it public):</label><br />
		 	<input name="email" class="smalltextbox" type="text" size=100 value="<%= profile.getEmail() %>" /><br /><br />
		 	<label for="location">Location:</label><br />
		 	<input name="location" class="smalltextbox" type="text" size=100 value="<%= profile.getLocation() %>" /><br /><br />
		 	<label for="websiteurl">Your Website URL:</label><br />
		 	<input name="websiteurl" class="smalltextbox" type="text" size=100 value="<%= AutoLinkFormatter.extractUrl(profile.getWebsiteUrl()) %>" /><br /><br />
		 	<label for="info">Info (2000 characters maximum):</label><br />
		 	<textarea class="textbox" name="info" rows=10 cols=80><%= profile.getInfo() %></textarea><br /><br />

		 	<%= Confirm.getKey(request.getUserPrincipal().getName()) %>

		 	<input type="submit" value="      Submit      " />
	
		</form>	
		
		<br />
		
	</div>

	<!--<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>-->
	<!--<script type="text/javascript">_uacct = "UA-1148679-1";urchinTracker();</script>--> 

</body>
</html>
